<template>

</template>

<script>
import { getPictureList } from 'api/userInfo'
import picUtil from '@/utils/picUtil'

export default {
  name: 'minixLoadPic',
  methods: {
    loadPic(picArray) {
      let that = this
      return new Promise((resolve, reject) => {
        //根据图片类型加载图片信息
        picArray.forEach((picType) => {
          getPictureList(that.selfUserInfo.id, picType)
            .then(res => {
              res = JSON.parse(res.data)
              let data = []
              if (res.length > 0) {
                let url = 'https://ggfw.hrss.foshan.gov.cn/fshr/resource/view/' + res[0].resourceid + '/0'
                data[picType] = [{ url: url, isImage: true }]
              } else {
                data[picType] = []
              }
              that.selfUserInfo = Object.assign({}, that.selfUserInfo, data)
              resolve(data)
              that.$forceUpdate()
            }).catch(err => {
            console.log(err)
          })
        })
      })

    }
  }
}
</script>

<style scoped>

</style>
